<template>
	<!-- 我的订单组件 -->
	<view class="wrap order">
		<text class="text_3">我的订单</text>
		<view class="flex-col section_2">
		  <view class="tabBar " v-for="(item,index) in tabBar" :key="index" >
		    <view class=" items-center equal-division-item center"  @click="jumpTo(index)">
		      <image
		        :src="item.image"
		        class="image_5"
		      />
		      <text class="text_4">{{item.title}}</text>
		    </view>
		  </view>
		</view>
	</view>
</template>

<script>
	// 导入eventBus
	import {eventBus} from '../../main.js'
	export default{
		data(){
			return{
				tabIndex:0,
				tabBar:[
					
					{
						title:"待付款",
						image:'https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/5eedc9543259190011441867/60c321886d32e90012f09dc4/16240632337528305414.png'
					},
					{
						title:"待发货",
						image:'https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/5eedc9543259190011441867/60c321886d32e90012f09dc4/16240632337834988033.png'
					},
					{
						title:"待收货",
						image:'https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/5eedc9543259190011441867/60c321886d32e90012f09dc4/16240632337528305414.png'
					},
					{
						title:"待评价",
						image:'https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/5eedc9543259190011441867/60c321886d32e90012f09dc4/16240632337528305414.png'
					},
				]
			}
		},
		methods:{
			// 索引默认从0开始
			jumpTo(index){
				this.tabIndex=index;
				uni.navigateTo({
				    url: '/pages/personal-paying/personal-paying'
				});
				// 将我的订单组件用户点击的索引值传递给payBar组件
				uni.$on('send',res=>{
					uni.$emit('tabIndex',this.tabIndex)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.order{
		background: #FFFFFF !important;
		margin-top: 40rpx;
	}
	.equal-division-item_1 {
	  flex: 1 1 168rpx;
	  padding: 11rpx 0 10rpx;
	}
	.image_6 {
	  width: 64rpx;
	  height: 64rpx;
	}
	.text_5 {
	  margin-top: 20rpx;
	}
	.section_2 {
	  margin-top: 32rpx;
	  padding: 40rpx 38rpx 30rpx;
	  background-color: rgb(255, 255, 255);
	}
	.text_3 {
	  color: rgb(0, 0, 0);
	  font-size: 30rpx;
	  font-weight: 600;
	  line-height: 42rpx;
	  white-space: nowrap;
	  padding: 40rpx;
	}
	.equal-division {
	  margin-top: 17rpx;
	  color: rgb(0, 0, 0);
	  font-size: 26rpx;
	  line-height: 36rpx;
	  white-space: nowrap;
	}
	.equal-division-item {
	  padding: 17rpx 0 10rpx;
	  flex: 1 1 168rpx;
	}
	.equal-division-item_2 {
	  padding: 10rpx 0 10rpx;
	  flex: 1 1 168rpx;
	}
	.image_5 {
	  width: 64rpx;
	  height: 52rpx;
	}
	.text_4 {
	  margin-top: 26rpx;
	}
	.image_9 {
	  width: 64rpx;
	  height: 66rpx;
	}
	.text_8 {
	  margin-top: 19rpx;
	}
	.section_2{
		display: flex;
		// justify-content: space-around;
	}
	image{
		display: block !important;
		margin: auto auto 40rpx auto;
	}
	.center{
		text-align: center;
		
	}
	.tabBar{
		flex: 1;
	}
</style>
